<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
	<TITLE></TITLE>
	<META NAME="GENERATOR" CONTENT="OpenOffice.org 3.2  (Unix)">
	<META NAME="CREATED" CONTENT="20110115;11335800">
	<META NAME="CHANGED" CONTENT="20110206;14294100">
	<STYLE TYPE="text/css">
	<!--
		@page { size: 8.27in 11.69in; margin: 0.79in }
		P { margin-bottom: 0.08in }
		PRE { font-family: "Times New Roman" }
	-->
	</STYLE>
</HEAD>
<BODY LANG="el-GR" DIR="LTR">
<PRE><FONT SIZE=5><B>Building ScalaLab from sources</B></FONT>

We present a detailed guide on how to build ScalaLab from sources from within Netbeans. We use Netbeans 6.1 although and more recent versions can also be used. The example steps below also build ScalaLab using Windows Vista platform. At Unix based platform (e.g. Linux, OpenSolaris) the steps are the same.


<FONT SIZE=4><B>Building Steps</B></FONT>

<B>Step 1 – Folder setup </B>
<SPAN STYLE="font-weight: normal">Create a new folder on your disk, e.g.  “</SPAN><I><SPAN STYLE="font-weight: normal">C:\NBProjects\scalalabDev</SPAN></I>”  <SPAN STYLE="font-weight: normal">and place the ScalaLab sources, </SPAN><I><SPAN STYLE="font-weight: normal">file “ScalaLabSrc.zip” </SPAN></I><SPAN STYLE="font-weight: normal">within. Unzip it.  A folder “</SPAN><I><SPAN STYLE="font-weight: normal">C:\NBProjects\scalalabDev\</SPAN></I><SPAN STYLE="font-weight: normal">s</SPAN><I><SPAN STYLE="font-weight: normal">calalabSrc” </SPAN></I><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">is created. Also create a folder “</SPAN></SPAN><I><SPAN STYLE="font-weight: normal">scalalabPr”</SPAN></I> <SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">for your Netbeans project. </SPAN></SPAN>

<B>Step 2 – Creation of Netbeans project  </B>
Use the “<I>New Project” </I><SPAN STYLE="font-style: normal">to create your scalaLab project. In </SPAN>“<I>Choose Project”</I>  <SPAN STYLE="font-style: normal">specify “</SPAN><I>Java”, “Java Project with Existing Sources” </I><SPAN STYLE="font-style: normal">and then press “</SPAN><I>Next”.</I>
At the “Name and Location” form, specify as “<I>Project Name” </I><SPAN STYLE="font-style: normal">for example “</SPAN><I>scalalab” </I><SPAN STYLE="font-style: normal">and for</SPAN> “<I>Project Folder” </I><SPAN STYLE="font-style: normal">your folder created at Step 1, e.g. “</SPAN><I>C:\NBProjects\scalalabDev\scalalabPr”. </I>

<I><B>IMPORTANT!!:   The Netbeans project folder  should be named exactly as “scalalabPr” in order ScalaLab to run from within Netbeans properly.</B></I>

<SPAN STYLE="font-style: normal">Press “</SPAN><I>Next”</I>
At the “<I>Existing Sources” </I><SPAN STYLE="font-style: normal">form specify as “</SPAN><I>Source Package Folders” </I><SPAN STYLE="font-style: normal">your folder with the unzipped ScalaLab sources, e.g. </SPAN>“<I><SPAN STYLE="font-weight: normal">C:\NBProjects\</SPAN></I><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">s</SPAN></SPAN><I><SPAN STYLE="font-weight: normal">calalabSrc” .</SPAN></I>
<SPAN STYLE="font-weight: normal">Click  </SPAN>“<I><SPAN STYLE="font-weight: normal">Finish”. </SPAN></I><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">The Netbeans responds with a question on what to do with the compiled class files existing in ScalaLab sources. It is very important </SPAN></SPAN><I><B>NOT</B></I> <SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">to delete these files. Thus choose “</SPAN></SPAN><I><SPAN STYLE="font-weight: normal">Ignore” </SPAN></I><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">for retaining the compiled class files.</SPAN></SPAN>

<B>Step 3 – Specification of Libraries.</B>
This step requires the downloading of the ScalaLab executable files (i.e. The two .zip files, of PART1 and PART2) and to extract them at your ScalaLab source folder. After extracted these files a folder <I><B>lib </B></I><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">is created that contains libraries essential for both the execution of ScalaLab and for compilation of its sources.</SPAN></SPAN>
Scalalab is based on libraries of three types:
<B>a.  </B><I><U><B>The Scala language jars:</B></U></I><SPAN STYLE="text-decoration: none">   “</SPAN><SPAN STYLE="text-decoration: none"><I><B>scala-compiler.jar”, “scala-library.jar”, “scala-swing.jar”.  </B></I></SPAN><SPAN STYLE="text-decoration: none"><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">These are the official Scala Language files implementing the Scala Compiler, Scala Libraries and Scala Swing respectively. In order to implement ScalaLab we have retain </SPAN></SPAN></SPAN><SPAN STYLE="font-style: normal"><U><B>unaltered</B></U></SPAN><SPAN STYLE="text-decoration: none"> </SPAN><SPAN STYLE="text-decoration: none"><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">the Scala language implementation. Thus, future versions of Scala can be directly utilized in ScalaLab.</SPAN></SPAN></SPAN>
<SPAN STYLE="text-decoration: none"><SPAN STYLE="font-style: normal"><B>b. </B></SPAN></SPAN><SPAN STYLE="text-decoration: none"><I><B>The ScalaLab auxiliary core numerical libraries file, “scalalabLibs.jar”</B></I></SPAN><SPAN STYLE="text-decoration: none">   </SPAN><SPAN STYLE="text-decoration: none"><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">In order to retain the ScalaLab core small we have placed a few numerical libraries within the core of ScalaLab, consisting mainly of the routines of the </SPAN></SPAN></SPAN><SPAN STYLE="text-decoration: none"><I><B>NUMAL</B></I></SPAN><SPAN STYLE="text-decoration: none"> </SPAN><SPAN STYLE="text-decoration: none"><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">library and the basic plotting libraries. Other (also excellent) numerical libraries are shipped within a seperate jar file, namely the </SPAN></SPAN></SPAN><SPAN STYLE="text-decoration: none">“</SPAN><SPAN STYLE="text-decoration: none"><I><SPAN STYLE="font-weight: normal">scalalabLibs.jar”</SPAN></I></SPAN><SPAN STYLE="text-decoration: none"> </SPAN><SPAN STYLE="text-decoration: none"><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">file. Java sources for these libraries is available and can be obtained from the “</SPAN></SPAN></SPAN><SPAN STYLE="text-decoration: none"><I><SPAN STYLE="font-weight: normal">scalalabLibsSrc.zip”</SPAN></I></SPAN><SPAN STYLE="text-decoration: none"> </SPAN><SPAN STYLE="text-decoration: none"><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">file. Currently, the basic libraries within the </SPAN></SPAN></SPAN><SPAN STYLE="text-decoration: none">“</SPAN><SPAN STYLE="text-decoration: none"><I><SPAN STYLE="font-weight: normal">scalalabLibs.jar” </SPAN></I></SPAN><SPAN STYLE="text-decoration: none"><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">file are: 1. The </SPAN></SPAN></SPAN><SPAN STYLE="text-decoration: none"><I><SPAN STYLE="font-weight: normal">Jsci </SPAN></I></SPAN><SPAN STYLE="text-decoration: none"><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">library that provides mainly an excellent Wavelet analysis Java package,  2. The </SPAN></SPAN></SPAN><SPAN STYLE="text-decoration: none"><I><SPAN STYLE="font-weight: normal">Efficient Java Matrix Library,  3. </SPAN></I></SPAN><SPAN STYLE="text-decoration: none"><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">The  </SPAN></SPAN></SPAN><SPAN STYLE="text-decoration: none"><I><SPAN STYLE="font-weight: normal">Matrix Toolbox for Java </SPAN></I></SPAN><SPAN STYLE="text-decoration: none"><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">library, 4. The </SPAN></SPAN></SPAN><SPAN STYLE="text-decoration: none"><I><SPAN STYLE="font-weight: normal">Parallel Colt </SPAN></I></SPAN><SPAN STYLE="text-decoration: none"><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">library.  5. The </SPAN></SPAN></SPAN><SPAN STYLE="text-decoration: none"><I><SPAN STYLE="font-weight: normal">JFreeChart </SPAN></I></SPAN><SPAN STYLE="text-decoration: none"><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">plotting library.</SPAN></SPAN></SPAN>
Although all these libraries can be utilized within ScalaLab using their Java interface, currently only the Efficient Java Matrix Library is wrapped with Scala classes for more convenient access. A lot of work remains!!
<B><SPAN STYLE="text-decoration: none"><SPAN STYLE="font-style: normal">c. </SPAN></SPAN><SPAN STYLE="text-decoration: none"><I>Auxiliary jars, e.g. Help files, the jEdit jar files etc.</I></SPAN></B>

Thus, after obtaining the .jar library files of ScalaLab within the <I>lib </I><SPAN STYLE="font-style: normal">folder specify </SPAN><I><B>all</B></I>  <SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">them  as “</SPAN></SPAN><I><SPAN STYLE="font-weight: normal">Compile-time Libraries”. </SPAN></I><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">It is very important also to specify and the folder with the ScalaLab sources with the “</SPAN></SPAN><I><SPAN STYLE="font-weight: normal">Add JAR/Folder”</SPAN></I> <SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">button, since this folder contains compiled classes.</SPAN></SPAN>

 At the &quot;Run&quot; Tab specify as &quot;Run-time Libraries&quot;: first the &quot;Compiled Sources&quot;, and then the &quot;Classpath for Compiling Sources&quot; in order to run correctly within the Netbeans. 


<B>Step 4 Specification of Run-Time options. </B>

 At the <I>&quot;Run&quot;  </I>tab of the Netbeans Project Properties specify:
    <B>Main Class</B>:    <I><B>scalaExec.scalaLab.scalaLab</B></I>
    <B>Arguments</B>:   &lt; the full path to the .jar file that the Netbeans creates for your ScalaLab project &gt;
    <B>VM Options</B>:   Optionally specify:   <B>-Xss20m -Xms200m -Xmx1000m </B>   (for avoiding many overflow situations)





<B>Step 5.  Specifying “Source/Binary Format”  JDK 6.   </B><SPAN STYLE="font-weight: normal">This “easy” step is also illustated with the following picture.</SPAN>






<B>Figure 4  Specifing JDK 6 for Source/Binary format</B>




<B>Step 6    Finally (!) you can “Clean amd Build” and “Run” your ScalaLab project. </B>

For running outside Netbeans you should move the builded “<I>scalalab.jar” </I><SPAN STYLE="font-style: normal">from the “</SPAN><I>dist</I>” <SPAN STYLE="font-style: normal">folder, at the parent folder of the “</SPAN><I>lib</I>” <SPAN STYLE="font-style: normal">folder.</SPAN></PRE>
</BODY>
</HTML>